package com.cnpc.consumer.fegin;

import com.cnpc.producer.api.ITestProducerService;
import com.cnpc.producer.api.TestProducer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

/**
 * TestConsumerFegin
 *
 * @date: 2020/4/20 13:37
 * @author: ruikanwang
 * @version: V0.1
 * Copyright: 2020 www.richfit.com. All rights reserved.
 */
@FeignClient(name = "testproducer-service",fallback = TestConsumerFallback.class)
public interface TestConsumerFegin extends ITestProducerService {
}

@Component
class TestConsumerFallback implements TestConsumerFegin {

    @Override
    public TestProducer getTestProducer(String name) {
        return new TestProducer(0,"fallback");
    }
}